﻿using System;
using System.Collections.Generic;
using System.Text;

namespace _4._3Counter
{
    class Count
    {
        public event Action<Product> CountEvent;
        public void AllCounter(Product product)
        {
            if (product.Num > 0)//如果库存>0
            {
                product.Num--;
                CountEvent = Program.OK;
            }
            else
                CountEvent = Program.No;
            CountEvent += Program.All;
            CountEvent?.Invoke(product);
        }
    }
}
